Microcontrollers are single chip devices used to monitor and control the response of an apparatus to its surroundings. For example, they can be used to interpret user input keystrokes on a microwave oven and then control the microwave oven's response. Often, microcontrollers are designed to respond to multiple interrupts, such as an emergency shut off the microwave oven in response to someone opening its door. Microcontrollers traditionally are specialized for single bit manipulation and include a CPU, RAM, ROM, serial interfaces, parallel interfaces, timers, and interrupt scheduling circuitry.
There are several types of microcontrollers, but a popular family of 8-bit microcontrollers is based on the 8051 microcontroller architecture first introduced by Intel Corp. in 1981. This architecture traditionally used a ROM to hold program, or code, memory to control its operation. In essence, the code memory holds a list of instructions which tell the microcontroller how to respond to various stimuli. A separate memory, typically a RAM, holds data entries, i.e. intermediate results as well as temporary data constants. Since the program memory was stored in a ROM, it could not be changed and the microcontroller itself had to be replaced if the code program had to be updated. This made the prospect of introducing a new instruction program, i.e. code, to microcontrollers in the field very labor intensive.
Later, the code ROM was replaced with an EPROM, which permitted the altering of the instruction program without having to discard the microcontroller. EPROMs can be erased by subjecting them to ultraviolet light for several minutes, and they can then be re-programmed by means of an EPROM programming apparatus. This allowed engineers to test various instruction programs before sending the end-product microcontroller to the field. Once in the field, however, the labor costs associated with physically removing the microcontroller from the field, subjecting it to ultraviolet light for erasure and applying it to an EPROM programmer to update its instruction program, still made updates to microcontroller's program memory prohibitive.
Further improvements to the basic 8051 microcontroller architecture were disclosed in U.S. Pat. No. 4,782,439 to Borkar et al., relating to improved memory access, and in U.S. Pat. No. 4,780,814 to Hayek, which disclosed a communication interface. Although neither of these patents addressed the inflexibility of the 8051's code memory, this was not considered a problem since changes to the code memory of a microcontroller were traditionally rare. This situation changed, however, when microcontrollers were applied to more recent versatile applications such as cellular telephones and cable reception boxes.
A major improvement directed toward improving the flexibility of the 8051 architecture was disclosed in U.S. Pat. No. 5,493,534 assigned to the same assignee as the present invention. U.S. Pat. No. 5,493,534 introduced the use of a type of FLASH memory to hold program memory. Additionally, U.S. Pat. No. 5,493,534 introduced a voltage pump into the 8051 architecture which allowed the microcontroller to generate all erasing and programming voltages internally without the need of an EPROM or EEPROM programmer. By making a communication link with a PC board on which the microcontroller resided in the field, one could remotely update the microcontroller's program memory. Thus, it was no longer necessary to remove the microcontroller from the field when the program memory needed to be updated.
The recent use of microcontrollers in these more versatile applications has also necessitated the use of user specific data such as registration numbers, access codes, etc. This type of data is liable to change somewhat frequently and-needs to be retained even after power is removed from the microcontroller. Since the traditional 8051 architecture supports an instruction set directed toward manipulation of data memory only in a RAM, this type of more permanent data storage is typically stored in an external EEPROM chip configured to respond like a RAM memory to read and write requests from the 8051 microcontroller. The 8051's internal program memory, be it ROM, EPROM or FLASH, memory cannot be used for storing this type of long term user specific data for two reasons. First, all microcontrollers are designed to have only read access to their program -memory when they are in an active mode of operation. This is necessitated by the fact that since the microcontroller's ALU is controlled by instructions coming from the program memory, it cannot alter its program store while executing from it. Therefore, all microcontrollers must first be placed in an inactive, or reset, mode and externally controlled in order to have their internal program memory altered. Secondly, the ALU within the microcontroller needs to be able to constantly fetch its next instruction from the program memory even while writing updates to the data memory at the same time. This too necessitates the use of a second memory module for the data memory store.
U.S. Pat. No. 5,375,083 discloses an IC card microcomputer incorporating a ROM module for storing program memory, a RAM module for storing temporary data memory and an EEPROM module for storing long term data memory. But, as stated above, the 8051 architecture has an instruction set which does not support manipulation of an internal EEPROM data memory store, and the 083' patent is therefore directed towards a microcontroller having an architecture and instruction set incompatible with that of the 8051 microcontroller family. This limits its application. The 083' patent also expounds on some of the difficulties of incorporating a separate EEPROM data memory module in addition to the ROM program, or code, memory module into the IC card.
As stated above, a main reason why two separate code and data memory modules are necessary is that the CPU within the microcontroller needs to be constantly fetching new instructions from the code memory even while it is writing updates to the data memory. Thus, incorporation of a nonvolatile data memory store into a microcontroller makes inefficient use of available memory space since it cannot access existing nonvolatile memory, and further complicates its design and layout by requiring an additional memory module, such as an EEPROM module, added to the microcontroller.
Still another limitation of microcontrollers is their limited amount of addressable program and data space, which is typically limited to a 16 bit address register. This is especially true of the 8051 family of microcontrollers. The 8051 is capable of internally addressing up to 2 16, or 64K, program memory locations, but this much program memory is typically not located internal to the microcontroller. Therefore, an External Access, EA, pin permits the 8051 to access program memory external to itself. For example, if the microcontroller has no internal program memory, then the EA pin is external tied low and all program fetch instructions are directed toward program memory external to the microcontroller. If the 8051 does have some internal program memory, then the EA pin is tied high and program fetch instructions which lie within the microcontroller's internal memory are accessed internally, and fetch instructions lying outside the available internal memory are automatically directed toward external memory. In either case, the microcontroller cannot access more memory than is available with 16 address bits, i.e. 64K.
The case of data memory is even more restrictive. The 8051 internal architecture has an 8-bit, or 256, address capacity for internal data access, although this amount can be slightly extended by using indirect addressing. In order to access its full 64K of data memory space, one needs to use a MOVX instruction, which utilizes a 16-bit address register and accesses only external data memory. This has traditionally not been a problem since data memory had been limited to RAM, which holds only temporary data, has relatively large memory cells and has a quick access time to external memory.
What is needed is an 8-bit 8051 type microcontroller with more efficient and more flexible use of memory. It is an object of the present invention to provide a microcontroller which eliminates the need for two separate and independent code and data memory modules and thereby make more efficient use of available chip area.
It is another object of the present invention to provide a microcontroller whose addressable space is not limited by the size of its address register.
It is yet another object of the present invention to facilitate the construction of look-up tables in internal and external data memory space.